﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class Pages_USLogin : System.Web.UI.UserControl
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
       DALThanhVien tv = new DALThanhVien();
        string email;
        string pass;
        email = txtEmail.Text.Trim();
        pass = txtMatKhau.Text.Trim();
        if (tv.CheckLogin(email, pass))
        {
            Session["User"] = email;
            Response.Redirect("Default.aspx");
        }
        else
        {
            lblMessage.Text = "<br>Tài khoản hoặc mật khẩu không đúng.";
            return;
        }
    }
}